package behavior.iterator;

import java.util.ArrayList;
import java.util.List;

public class ComputerCollege implements College {
    List<Department> departmentList = new ArrayList<Department>();

    ComputerCollege(){
        addDepartment("Java专业","Java专业desc");
        addDepartment("Php专业","Php专业desc");
        addDepartment("iOS专业","iOS专业desc");
    }

    @Override
    public String getName() {
        return "计算机学院";
    }

    @Override
    public void addDepartment(String name, String desc) {
        departmentList.add(new Department(name,desc));
    }

    @Override
    public Iterator createIterator() {
        return new ComputerCollegeIterator(departmentList);
    }
}
